home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark17.i < prev    next >
Text File  |  1995-04-19  |  1KB  |  98 lines

  1.  
  2. Procedure Spark17;
  3.  
  4. Const
  5.     max4lines = 50;
  6. Type
  7.     Sp1lines    = Array[1..max4lines] of line;
  8.     Sp1LinesPtr = ^Sp1Lines;
  9.  
  10. Var
  11.     arr    : Sp1LinesPtr;
  12.     a1x,a1y,
  13.     a2x,a2y,
  14.     CCNT,
  15.     actualline : Short;
  16.  
  17.  
  18. Procedure Inner17;
  19. Begin
  20.       With arr^[actualline] do begin
  21.         x1 := a1x;        y1 := a1y;
  22.         x2 := a2x;        y2 := a2y;
  23.       end;
  24.  
  25.       DrawLine( Adr(arr^[actualline]), CCNT );
  26.  
  27.       inc( CCNT );
  28.       If CCNT >= maxColors then CCNT := 2;
  29.  
  30.       inc( actualline );
  31.       If actualline >= max4lines then actualline := 1;
  32. End;
  33.  
  34. Begin
  35.     New(arr);
  36.     ActualLine := 1;
  37.  
  38. { ** old .sp15 : ** }
  39.  
  40.     CCNT := 2;    { color }
  41.  
  42.     a1x := 60;    a1y := 28;
  43.     a2x := 260;    a2y := 230;
  44.  
  45.     Repeat
  46.       EraseLine( Adr(arr^[actualline]) );
  47.  
  48.       If a1y=28    then inc(a1x);
  49.       If a1y=230   then dec(a1x);
  50.  
  51.       If a1x=260   then inc(a1y);
  52.       If a1x=60    then dec(a1y);
  53.  
  54.       If a2y=28    then inc(a2x);
  55.       If a2y=230   then dec(a2x);
  56.  
  57.       If a2x=260   then inc(a2y);
  58.       If a2x=60    then dec(a2y);
  59.  
  60.       Inner17;
  61.     Until LeftMouseButton;
  62.     Ciao;
  63.  
  64. { ** old .sp17 : ** }
  65.  
  66.     CCNT := 2;    { color }
  67.  
  68.     a1x := 61;    a1y := 28;
  69.     a2x := 260;    a2y := 29;
  70.     
  71.     SetSColors( Adr(GreenMap) );
  72.     Repeat
  73.       EraseLine( Adr(arr^[actualline]) );
  74.  
  75.       If a1y=28   then inc(a1x);
  76.       If a1y=230  then dec(a1x);
  77.  
  78.       If a1x=260  then inc(a1y);
  79.       If a1x=60   then dec(a1y);
  80.  
  81.       If a2y=28   then inc(a2x);
  82.       If a2y=230  then dec(a2x);
  83.  
  84.       If a2x=260  then inc(a2y);
  85.       If a2x=60    then dec(a2y);
  86.  
  87.       Inner17;
  88.  
  89.     Until LeftMouseButton;
  90.  
  91.     Ciao;
  92.  
  93.     Dispose(arr);
  94.     SetSColors(Adr(Def_Colors));
  95.  
  96. End;
  97.  
  98.